#include <stdio.h>

int main(int argc, char const *argv[])
{
    unsigned char x = 0x17, y,z;
    y = ~x;//位逻辑反
    printf("y=%#x\n", y);

    //位逻辑与
    x=0x56,y=0xac,z;
    z=x&y;
    printf("z=%#x\n",z);
    //位逻辑或
    z=x|y;
    printf("z=%#x\n",z);
    //位逻辑异或
    z=x^y;
    printf("z=%#x\n",z);


    return 0;
}
